Skip to content

Comments

Fix event loop warning filter and example configs#104

Merged
jlowin merged 10 commits intomainfrom
test-fastmcp-stdio-fix
Jan 7, 2026
Merged

Fix event loop warning filter and example configs#104
jlowin merged 10 commits intomainfrom
test-fastmcp-stdio-fix

Conversation

@jlowin
Copy link
Member

@jlowin jlowin commented Jan 7, 2026

Fixes the "Event loop is closed" warning that appears in CI when running MCP tests.

Changes

Warning suppression fix:

  • Fixed malformed filterwarnings syntax - message regex was in wrong position

MCP provider improvements:

  • Set keep_alive=False for stdio MCP servers to ensure proper subprocess cleanup on context exit
  • Points to fastmcp main branch which includes keep_alive passthrough support

Better error reporting:

  • Invalid frontmatter errors now show the filename (e.g., Invalid frontmatter in metrics_api.md:)

Examples fixes:

  • Fixed examples/everything/colin.toml config format (model-path/output-path instead of [paths])
  • Fixed all ref() calls to include .md extension
  • Fixed output: jsonoutput: {format: json} in metrics_api.md
  • Created examples/mcp/ for isolated MCP testing

Root cause

The warning occurs because asyncio's BaseSubprocessTransport.__del__ runs after the event loop closes on Linux. The subprocess IS properly terminated, but the Python transport object's cleanup is deferred to GC. This is a timing issue in the asyncio/anyio/MCP SDK interaction that can't be fully fixed from colin's side - the filter is the pragmatic solution.

@jlowin jlowin marked this pull request as ready for review January 7, 2026 23:14
@jlowin jlowin changed the title Test fastmcp stdio cleanup fix Fix event loop warning filter and example configs Jan 7, 2026
@jlowin jlowin merged commit cfd2dd5 into main Jan 7, 2026
3 checks passed
@jlowin jlowin deleted the test-fastmcp-stdio-fix branch January 7, 2026 23:14
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c8a0fa6d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"--no-banner",
"--log-level",
"ERROR",
"examples/mcp/mcp_server.py",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use project-relative MCP server path

The MCP command arg points to examples/mcp/mcp_server.py, but this config’s project root is examples/mcp and colin run uses the current directory as the project by default, so running the example from its own directory resolves the path to examples/mcp/examples/mcp/mcp_server.py and uvx cannot find the script. This only works when invoked from the repo root with an explicit project path; use a project-relative path like mcp_server.py (or set a cwd) so the example works when run from examples/mcp.

Useful? React with 👍 / 👎.

@jlowin jlowin added the bug Something isn't working label Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant